package com.jye.rseven.user.mapper;

import com.jye.rseven.domain.ChargeRecord;
import com.jye.rseven.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ChargeRecordMapper {


    //查询成功推广了多少人
    Integer findChargeRecordByuId(@Param("uId") int uId,@Param("status") String status);

    //根据id进行查询
    List<ChargeRecord> findRecordByuId(@Param("uId") int uId);

    //查询我推广的用户信息
    List<User> findMyChargeRecord(@Param("uId") int uId);

    //根据用户id查出推广的订单id
    List<Integer> findPayIdByuId(@Param("uId") int uId);

    //添加数据到佣金记录表
    void addChargeRecord(@Param("chargeRecord") ChargeRecord chargeRecord);

    //更新表
    int updateChargeRecord(@Param("chargeRecord") ChargeRecord chargeRecord);

    //查询状态
    String findChargeRecordStatusByuId(@Param("uId") int uId);

    //根据用户id查询用户的有效总佣金
    int findCharges(@Param("uId") int uId,@Param("status") String status);


}
